package main

import (
	"fmt"
	"net/http"
)

func main() {
	// 处理根路径，返回 hello.html
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		http.ServeFile(w, r, "hello.html")
	})

	// 提供静态文件
	http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))

	port := 8080
	fmt.Printf("服务器已启动，访问 http://localhost:%d\n", port)
	err := http.ListenAndServe(fmt.Sprintf(":%d", port), nil)
	if err != nil {
		fmt.Println("服务器错误:", err)
	}
}

